package cn.MaySoon.shenfu;

import org.bukkit.entity.Player;
import org.serverct.ersha.api.AttributeAPI;
import org.serverct.ersha.attribute.data.AttributeData;
import org.serverct.ersha.attribute.data.AttributeSource;

import java.util.List;

public class AP {
    public static void updatePlayerAttribute(Player p) {
        shenfu  shenfu = 	main.PlayerShenFuData.get(p);
        int level =shenfu.getPlayerlevel();
        List<String> Attribute =  main.config.getStringList("shenfu."+level+".attr");
        Attribute.add("撕裂: "+ shenfu.getPlayerjie());
        AttributeData data = AttributeAPI.getAttrData(p);

        AttributeSource source =	AttributeAPI.getAttributeSource(Attribute, false);
        main.PlayerAttribute.put(p,source);

        AttributeAPI.addSourceAttribute(data, "shenfu", Attribute, false);


    }
}
